---
title: Demo Phi4
---

## Code

```python cookbook/models/ollama/demo_phi4.py
from agno.agent import Agent, RunOutput  # noqa
from agno.models.ollama import Ollama

agent = Agent(model=Ollama(id="phi4"), markdown=True)

# Print the response in the terminal
agent.print_response("Tell me a scary story in exactly 10 words.")

```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install Ollama">
    Follow the [Ollama installation guide](https://github.com/ollama/ollama?tab=readme-ov-file#macos) and run:
    ```bash
    ollama pull phi4
    ```
  </Step>

  <Step title="Install libraries">
    ```bash
    pip install -U ollama agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python cookbook/models/ollama/demo_phi4.py
    ```

    ```bash Windows
    python cookbook/models/ollama/demo_phi4.py
    ```
    </CodeGroup>
  </Step>
</Steps>
